package com.hxd.otc.module.wallet.bean;

import android.text.TextUtils;

import com.hxd.otc.R;

import java.io.Serializable;
import java.util.List;

/**
 * 作  者 :  卫广玉
 * 时  间 :  2018/6/14 11:31
 * 描  述 :  钱包我的资产
 */
public class WalletAccountInfoBean implements Serializable {
    /**
     * aecTotalFund (number, optional): 所有币种折合AEC资产 ,
     * aecWalletAddress (string, optional): AEC钱包地址 ,
     * btc2aecPrice (number, optional): AEC购买BTC对应的价格 ,
     * btc2mscPrice (number, optional): MSC购买BTC对应的价格 ,
     * btcWalletAddress (string, optional): BTC钱包地址 ,
     * cnyTotalFund (number, optional): 所有币种折合AEC资产兑换人民币价格 ,
     * holdCoinDetailVoList (Array[HoldCoinDetailVo], optional): 持币情况汇总 ,
     * ltcWalletAddress (string, optional): LTC钱包地址 ,
     * mscWalletAddress (string, optional): MSC钱包地址 ,
     * ethWalletAddress (string, optional): ETH钱包地址 ,
     * userId (string, optional): 用户ID
     */
    private double aecTotalFund;
    private double btc2aecPrice;
    private double btc2mscPrice;
    private double cnyTotalFund;
    private List<HoldCoinDetailVo> holdCoinDetailVoList;
    private String userId;


    public double getAecTotalFund() {
        return aecTotalFund;
    }

    public void setAecTotalFund(double aecTotalFund) {
        this.aecTotalFund = aecTotalFund;
    }

    public double getBtc2aecPrice() {
        return btc2aecPrice;
    }

    public void setBtc2aecPrice(double btc2aecPrice) {
        this.btc2aecPrice = btc2aecPrice;
    }

    public double getBtc2mscPrice() {
        return btc2mscPrice;
    }

    public void setBtc2mscPrice(double btc2mscPrice) {
        this.btc2mscPrice = btc2mscPrice;
    }

    public double getCnyTotalFund() {
        return cnyTotalFund;
    }

    public void setCnyTotalFund(double cnyTotalFund) {
        this.cnyTotalFund = cnyTotalFund;
    }

    public List<HoldCoinDetailVo> getHoldCoinDetailVoList() {
        return holdCoinDetailVoList;
    }

    public void setHoldCoinDetailVoList(List<HoldCoinDetailVo> holdCoinDetailVoList) {
        this.holdCoinDetailVoList = holdCoinDetailVoList;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }


    public static class HoldCoinDetailVo implements Serializable {
        /**
         * balance (number, optional): 可用金额 ,
         * coinType (string, optional): 币种 ,
         * frozenBlance (number, optional): 冻结金额
         */
        public double balance;
        public String coinType;
        public double frozenBlance;
        public String address;//钱包地址 ,
        public double totalAmount;//总数量
        public double totalLegalTenderAmount;//币总数量折合法币
        public String legalTenderUnit;//法币单位 ,

        public double getBalance() {
            return balance;
        }

        public void setBalance(double balance) {
            this.balance = balance;
        }

        public String getCoinType() {
            return coinType;
        }

        public void setCoinType(String coinType) {
            this.coinType = coinType;
        }

        public double getFrozenBlance() {
            return frozenBlance;
        }

        public void setFrozenBlance(double frozenBlance) {
            this.frozenBlance = frozenBlance;
        }

        public int getIconLogoResId() {
            if (TextUtils.isEmpty(coinType)) return R.mipmap.icon_wallet_coin_logo_aec;
            switch (coinType.toUpperCase()) {
                case "BTC":
                    return R.mipmap.icon_wallet_coin_logo_btc;
                case "ETH":
                    return R.mipmap.icon_wallet_coin_logo_eth;
                case "JPC":
                    return R.mipmap.icon_wallet_coin_logo_jpc;
                case "LTC":
                    return R.mipmap.icon_wallet_coin_logo_ltc;
                case "MSC":
                    return R.mipmap.icon_wallet_coin_logo_msc;
                case "TWC":
                    return R.mipmap.icon_wallet_coin_logo_twc;
                case "YFB":
                    return R.mipmap.icon_wallet_coin_logo_yfb;
                case "AEC":
                default:
                    return R.mipmap.icon_wallet_coin_logo_aec;
            }
        }

        @Override
        public String toString() {
            return "HoldCoinDetailVo{" +
                    "balance=" + balance +
                    ", coinType='" + coinType + '\'' +
                    ", frozenBlance=" + frozenBlance +
                    '}';
        }
    }

}
